import requests
from flask import Flask,request

from server.check_songs import get_top_songs_by_country

app = Flask(__name__)


@app.post('/get_top_songs')
def get_top_songs():
    data=request.get_json()
    authorization=data['get_token']
    if authorization:
        get_top_songs_by_country(authorization)
        return "数据写人成功"
    else:
        return "数据写人失败"


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)
